<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<style>
    *{
        margin: 0;
        padding: 0;
    }

    .container{
        width: 1200px;
        height: 80px;
        position: relative;
    }
    .container ul {
        display: flex;margin-top: 50px;
        border: 1px solid red;
        height: 100%;
    }
    .container ul li {
        list-style: none;
        flex: 1;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .slider{
        height: 10px;
        width: calc(100% / 6);
        /*background-color: yellow;*/
        position: absolute;
        bottom: 0;
        left: 0;
    }

    .container ul li:nth-of-type(1):hover~.slider{
        transform: translateX(0);
        background-color: lightseagreen;
    }

    .container ul li:nth-of-type(2):hover~.slider{
        transform: translateX(100%);
        background-color: yellow;
    }
    .container ul li:nth-of-type(3):hover~.slider{
        transform: translateX(calc(100% * 2));
        background-color: orange;
    }

    .container ul li:nth-of-type(4):hover~.slider{
        transform: translateX(calc(100% * 3));
        background-color: lightpink;
    }
    .container ul li:nth-of-type(5):hover~.slider{
        transform: translateX(calc(100% * 4));
        background-color: lightgreen;
    }
    .container ul li:nth-of-type(6):hover~.slider{
        transform: translateX(calc(100% * 5));
        background-color: lightgoldenrodyellow;
    }

</style>

<div class="container">
    <ul>
        <li>html</li>
        <li>css</li>
        <li>js</li>
        <li>java</li>
        <li>python</li>
        <li>php</li>
        <div class="slider"></div>

    </ul>
</div>

</body>
</html>
